package com.hcg.multidatasourceofanno2.mapper.cmmapper;

import com.hcg.multidatasourceofanno2.common.business.CommonMapper;
import com.hcg.multidatasourceofanno2.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface CmUserMapper extends CommonMapper<User> {
//    @Select("SELECT * from user where uid = #{uid}") 也是可以执行成功的
//    User selectById(@Param("uid") Long uid);

    User findById(@Param("uid") Long uid);

    @Insert("INSERT INTO user VALUES(#{uid},#{nickname},#{name},#{password},#{salt},#{mobile})")
    Integer addUser(@Param("uid") Long uid, @Param("nickname") String nickname, @Param("name") String name,
                    @Param("password") String password, @Param("salt") String salt, @Param("mobile") String mobile);

}
